//
//  MessageMainVCTableViewCell.m
//  ProductB
//
//  Created by lanou on 16/5/30.
//  Copyright © 2016年 ChenZheng. All rights reserved.
//

#import "MessageMainVCTableViewCell.h"
//图片高度
#define imageHeight 145
//label 高度
#define titleLabelHeight 30
@implementation MessageMainVCTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.iconImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, kWidth, imageHeight)];
        self.iconImageView.backgroundColor = [UIColor cyanColor];
        
        self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(5, imageHeight - 30, kWidth - 100, titleLabelHeight)];
//        self.titleLabel.backgroundColor = [UIColor redColor];
        [self.titleLabel setTextColor:[UIColor whiteColor]];
        [self.titleLabel setFont:[UIFont systemFontOfSize:13]];
        [self.contentView addSubview:_iconImageView];
        [self.contentView addSubview:_titleLabel];
    }
    return self;
}
//加载数据的方法
-(void)configureWithModel:(MessageMainModel *)model{
    self.titleLabel.text = model.title;
    [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:model.cover_image_url] placeholderImage:[UIImage imageNamed:@"陈瑶"]];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
